package com.itheima.Method;

public class Method04 {
    public static void main(String[] args) {
        new Method04().printOddNumber(12, 19);
    }


    public void printOddNumber(int n, int m) {
        System.out.println(n + "到" + m + "之間的奇数为:");
        int count = 0;
        for (int i = n; i <= m; i++) {
            if (i % 2 != 0) {
                count++;
                System.out.println(i);
            }
        }
        System.out.println("共" + count);
    }
}
